package com.liu.service.impl;


import com.liu.entity.Department;
import com.liu.entity.Disease;
import com.liu.mapper.DepartmentMapper;
import com.liu.service.DepartmentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Department)表服务实现类
 *
 * @author makejava
 * @since 2023-02-08 13:54:26
 */
@Service("departmentServiceImpl")
@Transactional
public class DepartmentServiceImpl implements DepartmentService {
    @Resource
    private DepartmentMapper departmentMapper;


    @Override
    public List<Department> findDepByHos(Integer id) {
        return this.departmentMapper.findDepByHos(id);
    }

    @Override
    public Department queryById(Integer id) {
        return this.departmentMapper.queryById(id);
    }

    @Override
    public List<Department> findAll() {
        return this.departmentMapper.findAll();
    }

    @Override
    public List<Department> queryAllByLimit(Integer pageNum, Integer pageSize, String name) {
        return this.departmentMapper.queryAllByLimit(pageNum,pageSize,name);
    }

    @Override
    public long count(String name) {
        return this.departmentMapper.count(name);
    }

    @Override
    public int insert(Department department) {
        return this.departmentMapper.insert(department);
    }

    @Override
    public int insertBatch(List<Department> entities) {
        return this.departmentMapper.insertBatch(entities);
    }

    @Override
    public int update(Department department) {
        return this.departmentMapper.update(department);
    }

    @Override
    public int deleteById(Integer id) {
        return this.departmentMapper.deleteById(id);
    }

    @Override
    public int deleteByIds(List<Integer> ids) {
        return this.departmentMapper.deleteByIds(ids);
    }

    @Override
    public List<Disease> findDisById(Integer id) {
        return this.departmentMapper.findDisById(id);
    }
}
